package com.cll.pmis.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.cll.pmis.common.validator.group.Insert;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author chenliangliang
 * @since 2018-06-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class InputDrug implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotBlank(message = "药品名不能为空",groups = {Insert.class})
    private String name;

    private String provider;
    @NotNull(message = "药品进价不能为空",groups = {Insert.class})
    private BigDecimal costPrice;
    @NotNull(message = "药品销售价格不能为空",groups = {Insert.class})
    private BigDecimal sellPrice;

    @NotNull(message = "药品数量不能为空",groups = {Insert.class})
    @Min(value = 1L,message = "药品数量至少为1",groups = {Insert.class})
    private Integer num;

    @NotBlank(message = "单位unit不能为空",groups = {Insert.class})
    private String unit;
    @NotBlank(message = "规格不能为空",groups = {Insert.class})
    private String specification;
    /**
     * 入库单号
     */
    @JSONField(serialize = false,deserialize = false)
    private  Integer inputId;

    private Date productTime;
    private Date overTime;

//    @NotBlank(message = "生产日期不能为空",groups = {Insert.class})
//    @TableField(exist = false)
//    private String ptime;
//
//    @NotBlank(message = "过期时间不能为空",groups = {Insert.class})
//    @TableField(exist = false)
//    private String otime;


}
